<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 
        <title>Welcome to Design Zone......</title>
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/ext-all.css" />
        <link rel="stylesheet" type="text/css" href="../../styles/dzbase.css" />
        <script type="text/javascript" src="../../scripts/ext/adapter/ext-base.js">
        </script>
        <script type="text/javascript" src="../../scripts/ext/ext-all.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/EditableItem.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/RangeMenu.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/GridFilters.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/Filter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/StringFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/ListFilter.js">
        </script>
		<script type="text/javascript" src="../../scripts/grid/filter/DateFilter.js"></script>
		<script type="text/javascript" src="../../scripts/grid/RowExpander.js">
        </script>
        <script type="text/javascript" src="../../scripts/i18nMessage.js">
        </script>
        <script type="text/javascript" src="../../scripts/utils.js">
        </script>
        <script type="text/javascript" src="../../scripts/imageViewer.js"></script>
        <script type="text/javascript">
        	var piMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.productidentification');
        	var yarnMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.yarn');
			var referenceMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.reference');
			var colorMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.pantonecolor');
			var fcMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomer');
			var fMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.factory');
            var message = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=message');
			
			var ctCollarTypeXmlLoader = new i18nMessage('../../servlet/CodeTableServlet?name=CtCollarType');
			var ctProductIdentificationStyleXmlLoader = new i18nMessage('../../servlet/CodeTableServlet?name=CtProductIdentificationStyle');
			var ctSeasonNumberXmlLoader = new i18nMessage('../../servlet/CodeTableServlet?name=CtSeasonNumber');
			var ctVersionXmlLoader = new i18nMessage('../../servlet/CodeTableServlet?name=CtVersion');
			var ctProductFamilyXmlLoader = new i18nMessage('../../servlet/CodeTableServlet?name=CtProductFamily');
			var ctDesignTypeXmlLoader = new i18nMessage('../../servlet/CodeTableServlet?name=CtDesignType');
			
			
			var store;
            var grid;
			
			var deleteCallback = function(btn){
                if (btn == 'yes') {
                    Ext.Ajax.request({
                        url: '../../servlet/ProductIdentificationServlet?action=2&id=' + deleteId,
                        success: function(o){
                            if (o.responseText == 'success') {
                                store.reload();
                                messageTip.msg(message.get('message.tip'), message.get('message.delete.successful'));
                            }
                            else {
                                messageTip.msg(message.get('message.tip'), message.get('message.delete.unsuccessful'));
                            }
                        },
                        failure: function(o){
                            messageTip.msg(message.get('message.tip'), message.get('message.delete.failure'));
                        },
                        params: {
                            foo: 'bar'
                        }
                    });
                }
            }
			
			Ext.onReady(function(){
                // create the Data Store
                
                
                store = new Ext.data.Store({
                    url: '../../servlet/ProductIdentificationServlet?action=100',
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'id',
                        totalRecords: 'itemTotal'
                    }, [ 
                    'index', 'id','ctCollarType', 'ctProductIdentificationStyle','ctProductFamilyCode', 'biMeasureSpecificationId',
					'ctMachineType', 'type', 'orderNumber',
					 'yarnNumber', 'dhlNumber', 'ctDesignType',
					 'style', 'customerLinkman', 'model', 
					 'ctSeasonNumber', 'createDate', 'reference',
					 'ctVersion', 'patronageNumer', 
					 'frontReference',
					 'frontPhotoName', 
					 'backReference', 
					 'backPhotoName',
					 'sleevesReference',
					 'sleevesPhotoName',  
					 'bottomThrumReference',
					 'bottomThrumPhotoName',  
					 'sleevesThrumReference',
					 'sleevesThrumPhotoName', 
					 'necklineThrumReference',
					 'necklineThrumPhotoName',
					 'needle',
					 'equipment',
					 'mainComposition',
					 'factoryNameCN',
					 'factoryNameEN',
					 'weight', 'comment',  'frontPhotoName','backPhotoName','otherPhotoName', 'attachment1Name', 'attachment2Name',
					 'sketch1Name','sketch2Name','sketch3Name','sketch4Name', 'modifyDate', 
					 'isSimilary', 'isNewfashioned', 'isDifficulty', 'densityColumms1','densityRows1', 'densityColumms2','densityRows2', 'densityColumms3','densityRows3', 'densityColumms4','densityRows4', 'densityColumms5','densityRows5', 'densityColumms6','densityRows6',
					 'dhlNumber', {name: 'biFranceCustomer.name', mapping: 'customerName'},
					 {name: 'biFranceCustomer.department', mapping: 'customerDepartment'},'isConfirmed','isYarned', 'isOrdered', 'isButtoned', 'isZipped', 'isAo','isSwatch','isMeasurement','isTrimmings','jauge']),
                    
                    remoteSort: true
                });
			
				store.setDefaultSort('id', 'desc');
				
				var filters = new Ext.grid.GridFilters({
					  filters:[
						{type: 'list',  dataIndex: 'ctSeasonNumber', options: ctSeasonNumberXmlLoader.getCtArray() },
						{type: 'list',  dataIndex: 'ctProductFamily', options: ctProductFamilyXmlLoader.getCtArray() },
						{type: 'list',  dataIndex: 'ctDesignType', options: ctDesignTypeXmlLoader.getCtArray() },
						{type: 'list',  dataIndex: 'ctCollarType', options: ctCollarTypeXmlLoader.getCtArray() },
						{type: 'list',  dataIndex: 'ctProductIdentificationStyle', options: ctProductIdentificationStyleXmlLoader.getCtArray() },
						{type: 'string',  dataIndex: 'biFranceCustomer.name'},
						{type: 'string',  dataIndex: 'biFranceCustomer.department'},
						{type: 'string',  dataIndex: 'model'},
						{type: 'string',  dataIndex: 'reference'},
						{type: 'string',  dataIndex: 'style'},
						{type: 'date',  dataIndex: 'createDate'},
						{type: 'date',  dataIndex: 'modifyDate'},
						{type: 'list',  dataIndex: 'ctVersion',options: ctVersionXmlLoader.getCtArray()},
						{type: 'string',  dataIndex: 'patronageNumer'}
				]});
				
				var expander = new Ext.grid.RowExpander({
			        tpl : new Ext.XTemplate(
						'<br/><p><b>' + referenceMessage.get('ui.reference.weight') + '(Kg):</b> {weight}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
						'<b>' + piMessage.get('ui.productidentification.ordernumber') + ':</b> {orderNumber}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
						'<b>' + fMessage.get('ui.factory.name') + ':</b> {factoryNameCN}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{factoryNameEN}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
						'<b>' + piMessage.get('ui.productidentification.set3') + ':</b> {[this.convertEqu(values.equipment)]}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
						'</p><br/>',
						'<p><img src="../../_temp/{sketch1Name}" width="150px" style="cursor: hand;" onclick="openImageViewer(this.src);"/> &nbsp;&nbsp;&nbsp;&nbsp;<img style="cursor: hand;" src="../../_temp/{sketch2Name}" width="150px" onclick="openImageViewer(this.src);"/>&nbsp;&nbsp;&nbsp;&nbsp;<img style="cursor: hand;" src="../../_temp/{sketch3Name}" width="150px" onclick="openImageViewer(this.src);"/>&nbsp;&nbsp;&nbsp;&nbsp;<img style="cursor: hand;" src="../../_temp/{sketch4Name}" width="150px" onclick="openImageViewer(this.src);"/></p><br/>',
						'<table><tr>',
						'<td width="180"><b>' + referenceMessage.get('ui.reference.front') + ':</b> {frontReference}<br/><b>' +  piMessage.get('ui.productidentification.densitycolumms') + '{densityColumms1}&nbsp;&nbsp;<b>' +  piMessage.get('ui.productidentification.densityrows') + '{densityRows1}</td>',
						'<td width="180"><b>' + referenceMessage.get('ui.reference.sleevesthrum') + ':</b> {sleevesThrumReference}<br/><b>' +  piMessage.get('ui.productidentification.densitycolumms') + '{densityColumms2}&nbsp;&nbsp;<b>' +  piMessage.get('ui.productidentification.densityrows') + '{densityRows2}</td>',
						'<td width="180"><b>' + referenceMessage.get('ui.reference.sleeves') + ':</b> {sleevesReference}<br/><b>' +  piMessage.get('ui.productidentification.densitycolumms') + '{densityColumms3}&nbsp;&nbsp;<b>' +  piMessage.get('ui.productidentification.densityrows') + '{densityRows3}</td>',
						'<td width="180"><b>' + referenceMessage.get('ui.reference.bottomthrum') + ':</b> {bottomThrumReference}<br/><b>' +  piMessage.get('ui.productidentification.densitycolumms') + '{densityColumms4}&nbsp;&nbsp;<b>' +  piMessage.get('ui.productidentification.densityrows') + '{densityRows4}</td>',
						'<td width="180"><b>' + referenceMessage.get('ui.reference.back') + ':</b> {backReference}<br/><b>' +  piMessage.get('ui.productidentification.densitycolumms') + '{densityColumms5}&nbsp;&nbsp;<b>' +  piMessage.get('ui.productidentification.densityrows') + '{densityRows5}</td>',
						'<td width="180"><b>' + referenceMessage.get('ui.reference.necklinethrum') + ':</b> {necklineThrumReference}<br/><b>' +  piMessage.get('ui.productidentification.densitycolumms') + '{densityColumms6}&nbsp;&nbsp;<b>' +  piMessage.get('ui.productidentification.densityrows') + '{densityRows6}</td></tr>',
						'<tr><td><img src="../../_temp/{frontPhotoName}" width="150px" onclick="openImageViewer(this.src);"/></td><td><img src="../../_temp/{sleevesThrumPhotoName}" width="150px" onclick="openImageViewer(this.src);"/></td><td><img src="../../_temp/{sleevesPhotoName}" width="150px" onclick="openImageViewer(this.src);"/></td>',
						'<td><img src="../../_temp/{bottomThrumPhotoName}" width="150px" onclick="openImageViewer(this.src);"/></td><td><img src="../../_temp/{backPhotoName}" width="150px" onclick="openImageViewer(this.src);"/></td><td><img src="../../_temp/{necklineThrumPhotoName}" width="150px" onclick="openImageViewer(this.src);"/></td></tr>',
						'</table>',
			            '<br/><br/>',
						//&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../_temp/{frontPhotoName}" width="150px"/>&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../_temp/{backPhotoName}" width="150px"/>&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../_temp/{otherPhotoName}" width="150px"/></p><br/>',
						'<br/><br/><p><b>' + piMessage.get('ui.productidentification.comment') + ':</b> {comment}</p><br/>', {
						     convertEqu: function(name){
						     	if(name.indexOf('equipmentother') == -1){
						     		return fMessage.get('ui.factory.' + name);
						     	}else{
						     		return fMessage.get('ui.factory.equipmentother') + name.substring(name.length - 1);
						     	}
						     }
						}
			        )
			    });
				
				grid = new Ext.grid.GridPanel({
                    title: piMessage.get('ui.productidentification.listtitle'),
                    store: store,
					stripeRows: true,
					plugins: [filters, expander],
                    height: 560,
                    columns: [expander, {
                        header: message.get('message.list.id'),
                        width: 50,
                        dataIndex: 'index',
                        sortable: false
                    },{
                        header: piMessage.get('ui.productidentification.seasonnumber'),
                        dataIndex: 'ctSeasonNumber',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.designtype'),
                        dataIndex: 'ctDesignType',
                        sortable: true
                    }, {
                        header: fcMessage.get('ui.francecustomer.name'),
                        dataIndex: 'biFranceCustomer.name',
                        sortable: true
                    }, {
                        header: fcMessage.get('ui.francecustomer.department'),
                        dataIndex: 'biFranceCustomer.department',
                        sortable: true
                    },{
                        header: referenceMessage.get('ui.reference.reference'),
                        dataIndex: 'reference',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.style'),
                        dataIndex: 'ctCollarType',
                        sortable: true
                    },{
                        header: '',
                        dataIndex: 'ctProductIdentificationStyle',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.chartversion'),
                        dataIndex: 'ctVersion',
                        sortable: true
                    },{
                        header: yarnMessage.get('ui.yarn.composition'),
                        dataIndex: 'mainComposition',
                        sortable: true
                    },{
                        header: fMessage.get('ui.factory.jauge'),
                        dataIndex: 'jauge',
                        sortable: true
                    },{
                        header: piMessage.get('ui.productidentification.yarn'),
                        width: 50,
                        dataIndex: 'isYarned',
                        sortable: false,
                        renderer: renderYarn
                    },
                    /*{
                        header: message.get('message.list.order'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderOrder
                    },
                    {
                        header: piMessage.get('ui.productidentification.button'),
                        width: 50,
                        sortable: false,
                        renderer: renderButton
                    },{
                        header: piMessage.get('ui.productidentification.accessory'),
                        width: 50,
                        sortable: false,
                        renderer: renderAccessory
                    },*/
                    {
                        header: piMessage.get('ui.productidentification.measurespecification'),
                        width: 50,
                        sortable: false,
                        renderer: renderEditItem
                    },
                    {
                        header: piMessage.get('ui.productidentification.trimmings'),
                        width: 50,
                        sortable: false,
                        renderer: renderTrim
                    },
                    {
                        header: piMessage.get('ui.productidentification.launching'),
                        width: 50,
                        dataIndex: 'isSwatch',
                        sortable: false,
                        renderer: renderProductLaunching
                    },
                    {
                        header: piMessage.get('ui.productidentification.approval'),
                        width: 50,
                        dataIndex: 'isConfirmed',
                        sortable: false,
                        renderer: renderProductConfirm
                    },
                    /*{
                        header: piMessage.get('ui.productidentification.upgrade'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderUpgrade
                    },{
                        header: message.get('message.edit.output'),
                        width: 50,
                        dataIndex: 'id',
                        sortable: false,
                        renderer: renderReport
                    },*/
                    {
                        header: message.get('message.list.print'),
                        width: 50,
                        sortable: false,
                        renderer: renderPrint
                    },
                    {
                        header: message.get('message.list.eidt'),
                        width: 50,
                        sortable: false,
                        renderer: renderEdit
                    },{
                        header: message.get('message.list.delete'),
                        width: 50,
                        sortable: false,
                        renderer: renderDelete
                    }],
                    viewConfig: {
                        forceFit: true
                    },
                    loadMask: true,
                    renderTo: 'productIdentificationGrid',
                    bbar: new Ext.PagingToolbar({
                        pageSize: 20,
                        store: store,
                        displayInfo: true
                    })
                });
                
                var startPage = getPrarmeterValue(window.location, 'startPage');
                var start;
                if (startPage == null || startPage == '') {
                    start = 0;
                }
                else {
                    start = (startPage - 1) * 20;
                }
                store.load({
                    params: {
                        start: start,
                        limit: 20
                    }
                });
				
				function renderEditItem(value, p, record){
					if(record.data.isMeasurement == 1){
						return String.format('<a href="product_measure_specification_item_edit.html?id={0}&msId={1}&startPage={2}" target="_self"><img src="../../images/icons/sitemap_color.png" title="' + piMessage.get('ui.productidentification.measurespecification') + message.get('message.list.eidtitem') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, record.data.biMeasureSpecificationId,  Math.floor((record.data.index - 1) / 20) + 1);					
					}else{
						return String.format('<a href="product_measure_specification_item_edit.html?id={0}&msId={1}&startPage={2}" target="_self"><img src="../../images/icons/sitemap_color.png" title="' + piMessage.get('ui.productidentification.measurespecification') + message.get('message.list.eidtitem') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, record.data.biMeasureSpecificationId,  Math.floor((record.data.index - 1) / 20) + 1);
					}
				}
				
				function renderTrim(value, p, record){
					if(record.data.isTrimmings == 1){
						return String.format('<a href="product_identification_trimming_edit.html?id={0}&msId={1}&startPage={2}" target="_self"><img src="../../images/icons/link.png" title="' + piMessage.get('ui.productidentification.trimmings') + message.get('message.list.eidtitem') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, record.data.biMeasureSpecificationId,  Math.floor((record.data.index - 1) / 20) + 1);					
					}else{
						return String.format('<a href="product_identification_trimming_edit.html?id={0}&msId={1}&startPage={2}" target="_self"><img src="../../images/icons/link.png" title="' + piMessage.get('ui.productidentification.trimmings') + message.get('message.list.eidtitem') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, record.data.biMeasureSpecificationId,  Math.floor((record.data.index - 1) / 20) + 1);
					}
				}
				
				function renderOrder(value, p, record){
					if (record.data.isOrdered == 1) {
						if(record.data.ctProductFamilyCode < 20)
							return String.format('<a href="product_identification_order_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/table.png" title="' + message.get('message.list.order') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
						else
							return String.format('<a href="product_identification_wl_order_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/table.png" title="' + message.get('message.list.order') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
					}
					else {
						if(record.data.ctProductFamilyCode < 20)
							return String.format('<a href="product_identification_order_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/table.png" title="' + message.get('message.list.order') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
						else
							return String.format('<a href="product_identification_order_wl_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/table.png" title="' + message.get('message.list.order') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
					}
                }
				
				function renderTag(value, p, record){
					if(record.data.isTagged == 1)
                    	return String.format('<a href="product_identification_tag_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/tag_blue_add.png" title="' + piMessage.get('ui.productidentification.tag') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
					else 
						return String.format('<a href="product_identification_tag_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/tag_blue_add.png" title="' + piMessage.get('ui.productidentification.tag') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
				
				function renderButton(value, p, record){
					if(record.data.isButtoned == 1)
                    	return String.format('<a href="product_identification_button_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/sport_golf.png" title="' + message.get('message.action.button') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                	else 
						return String.format('<a href="product_identification_button_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/sport_golf.png" title="' + message.get('message.action.button') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
				function renderZip(value, p, record){
					if(record.data.isZipped == 1)
                    	return String.format('<a href="product_identification_zip_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/link.png" title="' + message.get('message.action.zip') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                	else 
						return String.format('<a href="product_identification_zip_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/link.png" title="' + message.get('message.action.zip') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
				function renderAccessory(value, p, record){
					if(record.data.isAo == 1)
                    	return String.format('<a href="product_identification_accessory_others_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/bricks.png" title="' + message.get('message.action.accessoryothers') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                	else 
						return String.format('<a href="product_identification_accessory_others_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/bricks.png" title="' + message.get('message.action.accessoryothers') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
                function renderYarn(value, p, record){
					if(record.data.isYarned == 1)
                    	return String.format('<a href="product_dz_color_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/shading.png" title="' + piMessage.get('ui.productidentification.yarn') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
					else
						return String.format('<a href="product_dz_color_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/shading.png" title="' + piMessage.get('ui.productidentification.yarn') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
				
				function renderColor(value, p, record){
                    return String.format('<a href="" target="_self"><img src="../../images/icons/color_wheel.png" title="' + piMessage.get('ui.productidentification.color') + '" /></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
				
				function renderUpgrade(value, p, record){
					if(record.data.ctProductFamilyCode < 20)
						return String.format('<a href="product_identification_edit.html?id={0}&version={1}&startPage={2}" target="_self"><img src="../../images/icons/arrow_up.png" title="' + piMessage.get('ui.productidentification.upgrade') + '" /></a>', record.id, record.data.ctVersion, Math.floor((record.data.index - 1) / 20) + 1);
				}
				
				function renderReport(value, p, record){
					if(record.data.ctProductFamilyCode < 20)
						return String.format('<a href="product_identification_report.jsp?id={0}" target="_blank"><img src="../../images/icons/report.png" title="' + message.get('message.edit.output') + '" /></a>', record.id);
				}

				function renderPrint(value, p, record){
                    return String.format('<a href="javascript: void(0);" target="_self"><img src="../../images/icons/printer.png" title="' + message.get('message.list.print') + '" onclick="window.open(\'../../servlet/PDFExportServlet?action=1&input=tc&id={0}\');"/></a>', record.id);
                }
				
				function renderEdit(value, p, record){
                    return String.format('<a href="product_identification_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/pencil.png" title="' + message.get('message.list.eidt') + '" /></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
                
                function renderDelete(value, p, record){
                    return String.format('<a href="javascript: deleteItem(deleteCallback, {0});"><img src="../../images/icons/delete.png" title="' + message.get('message.list.delete') + '"/></a>', record.id);
                }
                function renderProductLaunching(value, p, record){
                	if(record.data.isSwatch == 1)
                    	return String.format('<a href="product_launching_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/chart_organisation.png" title="' + piMessage.get('ui.productidentification.launching') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                    else
                    	return String.format('<a href="product_launching_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/chart_organisation.png" title="' + piMessage.get('ui.productidentification.launching') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }
                
                function renderProductConfirm(value, p, record){
                	if(record.data.isConfirmed == '01')
                    	return String.format('<a href="product_confirm_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/arrow_right.png" title="' + piMessage.get('ui.productidentification.approval') + '" /><img width="10" src="../../images/icons/tick.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                    else
                    	return String.format('<a href="product_confirm_edit.html?id={0}&startPage={1}" target="_self"><img src="../../images/icons/arrow_right.png" title="' + piMessage.get('ui.productidentification.approval') + '" /><img width="10" src="../../images/icons/cross.png"></a>', record.id, Math.floor((record.data.index - 1) / 20) + 1);
                }

			});
        
        </script>
    </head>
    <body>
    		<div id="productIdentificationGrid"></div>
    </body>
</html>
